<template>
	<view>
		<remind-carinfo :dataBean="carInfo"></remind-carinfo>

		<view class="item">

			<view style="display: inline-flex; height: 80rpx; justify-content: space-between; margin: 0 20rpx;">
				<u-icon name="order" color="#1573FF" label="出险信息" labelColor="#333333">
				</u-icon>

			</view>

			<u-line color="#efefef" margin="0 0 30rpx 0"></u-line>

			<view v-if="detailInfo.applyNo">
				<view class="text-line">
					<text class="text-name">接收时间:</text>
					<text class="text-value">{{detailInfo.receiveDate|filterNull}}</text>
				</view>

				<view class="text-line">
					<text class="text-name">出险时间:</text>
					<text class="text-value">{{detailInfo.outDate|filterNull}}</text>
				</view>

				<view class="text-line">
					<text class="text-name">出险地点:</text>
					<text class="text-value">{{detailInfo.outAddr|filterNull}}</text>
				</view>

				<view class="text-line">
					<text class="text-name">报案人:</text>
					<text class="text-value">{{detailInfo.reporter|filterNull}}</text>
				</view>
				
				<view class="text-line">
					<text class="text-name">出险经过及原因:</text>
					<text class="text-value">{{detailInfo.outReason|filterNull}}</text>
				</view>

				<view class="text-line">
					<text class="text-name">事故等级:</text>
					<text class="text-value">{{detailInfo.outLevel|outLevel}}</text>
				</view>
				
				<view class="text-line">
					<text class="text-name">商业险是否赔付:</text>
					<text class="text-value">{{detailInfo.sxIsPay|sxIsPay}}</text>
				</view>
				
				<view v-if="detailInfo.sxIsPay == 1">
					<view class="text-line">
						<text class="text-name">商业险赔付保险公司:</text>
						<text class="text-value">{{detailInfo.sxInsuranceCompany|filterNull}}</text>
					</view>
					
					<view class="text-line">
						<text class="text-name">商业险赔付金额:</text>
						<text class="text-value">{{detailInfo.sxPayFee|filterNull}}</text>
					</view>
					
					<view class="text-line">
						<text class="text-name">商业险赔付时间:</text>
						<text class="text-value">{{detailInfo.sxPayDate|filterNull}}</text>
					</view>
				</view>
				
				<view class="text-line">
					<text class="text-name">交强险是否赔付:</text>
					<text class="text-value">{{detailInfo.qxIsPay|qxIsPay}}</text>
				</view>
				
				<view v-if="detailInfo.qxIsPay == 1">
					<view class="text-line">
						<text class="text-name">交强险赔付保险公司:</text>
						<text class="text-value">{{detailInfo.qxInsuranceCompany|filterNull}}</text>
					</view>
					
					<view class="text-line">
						<text class="text-name">交强险赔付金额:</text>
						<text class="text-value">{{detailInfo.qxPayFee|filterNull}}</text>
					</view>
					
					<view class="text-line">
						<text class="text-name">交强险赔付时间:</text>
						<text class="text-value">{{detailInfo.qxPayDate|filterNull}}</text>
					</view>
				</view>
				
				<view class="text-line">
					<text class="text-name">备注:</text>
					<text class="text-value">{{detailInfo.remark|filterNull}}</text>
				</view>
				
			</view>

			<view v-else class="nodata">
				<image src="/car/static/no_qx.png" mode=""></image>
				<text>暂无出险</text>
			</view>


			<view v-if="false">
				<u-line color="#efefef" dashed v-if="dataBean.insuranceButton">
				</u-line>

				<view class="btn-detail" v-if="dataBean.insuranceButton" @click="add()">
					出险
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	import remindCarinfo from '@/components/remindCarInfo/remind-carinfo.vue';
	import settings from '@/settings.js'
	import {
		apiOutInsuranceInfo
	} from '@/api/car-api.js'
	export default {
		components: {
			remindCarinfo,
		},
		data() {
			return {
				carInfo: {},
				detailInfo: {},
				imgs1:[]
			}
		},
		onLoad(op) {
			this.carInfo = op;
			this.getData();
		},
		methods: {

			getData() {
				apiOutInsuranceInfo(this.carInfo.id).then(res => {
					this.detailInfo = res.data;
				})
			},

			//新增出险
			add() {
				
			},

		}
	}
</script>

<style lang="scss" scoped>
	.btn-detail {
		width: 180rpx;
		height: 60rpx;
		border-radius: 50rpx;
		color: white;
		text-align: center;
		background-color: $blue15;
		font-size: 26rpx;
		line-height: 60rpx;
		align-self: flex-end;
		margin: 10rpx 20rpx 10rpx;
	}

	.nodata {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;

		image {
			width: 200rpx;
			height: 100rpx;
		}

		text {
			margin-top: 35rpx;
			margin-bottom: 60rpx;
			font-size: 24rpx;
			color: #C5D3E8;
		}
	}
</style>
